home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from util import UrlQuery, threaded
- import common
- import mail
- from mail.imap import IMAPMail
- from common import pref
- import time
- import logging
- log = logging.getLogger('aolmail')
-
- class AOLMail(IMAPMail):
- protocol = 'aolmail'
- default_domain = 'aol.com'
- AIM_SERVER = 'imap.aol.com'
-
- def __init__(self, *a, **kws):
- print 'AOL Constructor'
- print a, kws
- self._name = None
- kws.update(dict(imapserver = self.AIM_SERVER))
- IMAPMail.__init__(self, *a, **kws)
-
- get_email_address = common.emailaccount.EmailAccount.get_email_address
-
- def _get_name(self):
- return self._name
-
-
- def _set_name(self, name):
- if '@aol.' in name:
- name = name.split('@aol.')[0]
- elif '@aim.' in name:
- name = name.split('@aim.')[0]
-
- self._name = name
-
- name = property(_get_name, _set_name)
-
- def _get_mailclient(self):
- return pref('privacy.www_auto_signin', False)
-
-
- def _not_supported(self, val):
- pass
-
- mailclient = property(_get_mailclient, _not_supported)
- can_has_preview = True
-
- def reportSpam(self, msg):
- IMAPMail.reportSpam(self, msg)
- self.move(msg, 'Spam')
-
-
- def delete(self, msg):
- IMAPMail.delete(self, msg)
- self.move(msg, 'Trash')
-
-
- def archive(self, msg):
- IMAPMail.archive(self, msg)
- self.move(msg, 'Saved Mail')
-
-
- def open(self, msg):
- OpenAOLMail(self.name, self._decryptedpw(), msg.id)
-
-
- def urlForEmail(self, msg):
- return UrlQuery('http://webmail.aol.com/Lite/MsgRead.aspx?', dict(folder = 'Inbox', uid = '1.' + msg.id, seq = '1', start = '0'))
-
-
- def compose(self, to = '', subject = '', body = '', cc = '', bcc = '', **k):
- if self.mailclient:
- print 'edit compose', to, subject, body, cc, bcc, k
- body = body.replace('\n', '<br>')
- ComposeAOLMail(self.name, self._decryptedpw(), to = to, subject = subject, body = body, **k)
- print 'edit compose', 'done'
- else:
- print 'return url'
- return self._compose(to, subject, body, cc, bcc, **k)
-
-
- def _compose(self, to = '', subject = '', body = '', cc = '', bcc = '', **k):
- return UrlQuery('http://webmail.aol.com/25045/aim/en-us/Mail/compose-message.aspx', to = to, subject = subject, body = body, cc = cc, bcc = bcc, **k)
-
-
- def inbox_url(self):
- return 'http://mail.aol.com'
-
- inbox_url = property(inbox_url)
-
- def goto_inbox(self):
- if self.mailclient:
- SelectAOLMail(self.name, self._decryptedpw())
-
-
-
- def start_client_email(self, email = None):
- if email is not None:
- self.open(email)
- else:
- self.goto_inbox()
-
-
- def _get_options(self):
- opts = IMAPMail._get_options(self)
- opts.pop('email_address', None)
- opts.pop('mailclient', None)
- return opts
-
-
-
- def OpenAOLMail(un, password, msgid):
- login2 = login2
- import oscar
- login2.go_to_msg(un.encode('utf-8'), password.encode('utf-8'), msgid)
-
-
- def SelectAOLMail(un, password):
- login2 = login2
- import oscar
- print 'opening', un
- login2.go_to_mail(un.encode('utf-8'), password.encode('utf-8'))
-
-
- def ComposeAOLMail(un, password, **k):
- login2 = login2
- import oscar
- login2.go_to_compose(un.encode('utf-8'), password.encode('utf-8'), **k)
-
- if __name__ == '__main__':
- from wx.py.PyCrust import main
- main()
-
-